import {
  Entity,
  PrimaryGeneratedColumn,
  Column,
  ManyToOne,
  JoinColumn,
} from "typeorm";
import { ManualTimestamp } from "../decorators/manual-timestamp.decorator";
import { DeputyGeneral } from "./deputy-general.entity";

@Entity("player_deputy_warehouse")
@ManualTimestamp()
export class PlayerDeputyWarehouse {
  @PrimaryGeneratedColumn()
  id!: number;

  @Column({ type: "int" })
  player_id!: number;

  @Column({ type: "int" })
  deputy_id!: number;

  @Column("datetime", { comment: "创建时间" })
  created_at!: Date;

  @Column("datetime", { comment: "更新时间" })
  updated_at!: Date;

  @ManyToOne(() => DeputyGeneral)
  @JoinColumn({ name: "deputy_id" })
  deputy!: DeputyGeneral;
}
